package com.gdupt.until;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import java.io.IOException;
import java.io.InputStream;

public class DBUtil {
    public static SqlSessionFactory getFactory(){
        SqlSessionFactory factory = null;
        try {
            InputStream stream = Resources.getResourceAsStream("spring/spring-mybatisplus.xml");
            factory = new SqlSessionFactoryBuilder().build(stream);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return factory;
    }
}
